package org.example.springboot.service;

import org.example.springboot.dao.InBoundMapper;
import org.example.springboot.dao.OutBoundMapper;
import org.example.springboot.model.InBound;
import org.example.springboot.model.OutBound;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class OutBoundService {

    @Autowired
    private OutBoundMapper outBoundMapper;

    public String insertOutBound(String productName,String modelNumber, String supplierName,String quantity,String totalAmount, String outTime,String outOrderId){
        outBoundMapper.insertOutBound(productName,modelNumber,supplierName,quantity,totalAmount,outTime,outOrderId);
        return "succeed";
    }

    public List<OutBound> getAllOutBound(){
        return outBoundMapper.getAllOutBound();
    }

    public List<OutBound> findOutBoundByKeyword(String keyword){
        return outBoundMapper.findOutBoundByKeyword(keyword);
    }

    public OutBound getOutBoundById(int id){
        return outBoundMapper.getOutBoundById(id);
    }

    public void deleteOutBoundById(int id){
        outBoundMapper.deleteOutBoundById(id);
    }
}
